package com.sky.mapper.admin;

import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

public interface WorkSpaceMapper {

    @Select("select count(*) from sky_take_out.setmeal where status = #{status}")
    Integer getSetmealCountByStatus(Integer status);
    @Select("select count(*) from sky_take_out.dish where status = #{status}")
    Integer getDishCountByStatus(Integer disable);


    Integer getTodayOrderCountByStatus(LocalDateTime begin,LocalDateTime end,Integer status);

    @Select("select count(*) from sky_take_out.user where  create_time >= #{begin} and create_time <= #{end}")
    Integer getTodayNewUserCount(LocalDateTime begin,LocalDateTime end);

    @Select("select sum(amount) from sky_take_out.orders where order_time >= #{begin} and order_time <= #{end} and status = 5")
    Double getOrderSumByTimeLine(LocalDateTime begin,LocalDateTime end);
    @Select("select avg(amount) from sky_take_out.orders where order_time >= #{begin} and order_time <= #{end} and status = 5")
    Double getOrderAvgByTimeLine(LocalDateTime begin,LocalDateTime end);
}
